home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1996 #3 / Amiga Plus CD - 1996 - No. 3.iso / demo-versionen / databaseprofessional_v3.0 / picbase / overview.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-29  |  5KB  |  221 lines

  1. /* Overview.rexx, 21.12.95 Jörg Richter */
  2. /* Stil 1 */
  3.  
  4. OPTIONS RESULTS
  5.  
  6. thumbsize = 156
  7.  
  8. ADDRESS DataBase
  9.  
  10. GetMaskSize
  11. size = result
  12. width = WORD(size,1)
  13. height = WORD(size,2)
  14. IF WORDS(size) = 3 THEN
  15.   depth = WORD(size,3)
  16. ELSE
  17.   depth = 8
  18.  
  19. xoff = (width-((width%thumbsize)*thumbsize))%2
  20. yoff = (height-((height%thumbsize)*thumbsize))%2
  21.  
  22. IF depth = 8 THEN
  23.   LoadGadgets "PicBase/IdxGadgets/"
  24. ELSE
  25.   LoadGadgets "PicBase/IdxGadgetsGray/"
  26.  
  27. doit = 1
  28. stext = "Bitte wählen Sie ..."
  29.  
  30. DO FOREVER
  31.   IF doit = 1 THEN DO
  32.     Current
  33.     nr = result
  34.     CALL Overview
  35.   END
  36.   WaitCommand stext
  37.   command = result
  38.   stext = "Bitte wählen Sie ..."
  39.   doit = 0
  40.   IF WORDS(command) > 1 THEN DO
  41.     mx = WORD(command,1)
  42.     my = WORD(command,2)
  43.     qual = WORD(command,3)
  44.     Current
  45.     ds = result
  46.     IF qual = 10 THEN DO /* Gadget */
  47.       IF mx = 1 THEN DO /* <- */
  48.         nr = nr - (width%thumbsize)*(height%thumbsize)
  49.         IF nr < 1 THEN nr = 1
  50.         Goto nr
  51.         doit = 1
  52.       END
  53.       IF mx = 2 THEN /* -> */
  54.         doit = 1
  55.       IF mx = 8 THEN DO /* Abbruch */
  56.         Goto nr
  57.         Call Cancel
  58.       END
  59.       IF mx > 2 THEN DO
  60.         WaitCommand "Bitte wählen Sie das Bild aus ..."
  61.         command = result
  62.         IF WORDS(command) > 1 THEN DO
  63.           IF mx = 3 THEN qual = 0
  64.           IF mx = 4 THEN qual = 2
  65.           IF mx = 6 THEN qual = 3 /* DTP */
  66.           IF mx = 5 THEN qual = 9 /* Info */
  67.           IF mx = 7 THEN qual = 1
  68.           mx = WORD(command,1)
  69.           my = WORD(command,2)
  70.         END
  71.       END
  72.     END
  73.     IF (qual < 10) & (my < height) THEN DO
  74.       select = nr + (mx-xoff)%thumbsize + ((my-yoff)%thumbsize)*(width%thumbsize)
  75.       Goto select
  76.       IF qual = 1 THEN /* SHIFT */
  77.         Call Cancel
  78.       ELSE DO
  79.         IF qual = 0 THEN
  80.           Execute 1
  81.         IF qual = 3 THEN DO
  82.           GetData $F1
  83.           data = result
  84.           pos = LastPos("/",data)
  85.           CopyToClip LEFT(data,pos) || D2C(10) || SubStr(data,pos+1,Length(data)-pos)
  86.           stext = "Bildname ins ClipBoard kopiert"
  87.         END
  88.         IF qual = 9 THEN DO
  89.           GetData $F1
  90.           fname = result
  91.           GetData $F2
  92.           fsize = result
  93.           GetData $F3
  94.           psize = result
  95.           stext = fname || " (" || fsize || " KBytes, " || psize || ")"
  96.         END
  97.         IF qual = 2 THEN DO /* CTRL */
  98.           GetData $F1
  99.           fname = result
  100.           Mark
  101.           xx = ((mx-xoff)%thumbsize)*thumbsize+xoff
  102.           yy = ((my-yoff)%thumbsize)*thumbsize+yoff
  103.           IsMarked
  104.  
  105.           IF RC = 5 THEN DO
  106.             Box xx-2 yy-2 thumbsize-7 thumbsize-6 1000
  107.             color = 1
  108.             stext = "Bild demarkiert"
  109.             END
  110.           ELSE DO
  111.             Box xx-2 yy-2 thumbsize-7 thumbsize-6 1001
  112.             color = 3
  113.             stext = "Bild markiert"
  114.             END
  115.           fpos = MAX(LastPos("/",fname),LastPos(":",fname))
  116.           fname = UPPER(SubStr(fname,fpos+1,Length(fname)-fpos))
  117.           SetFont Helvetica.font 9 0
  118.           Text xx+(thumbsize%2)-4 yy+thumbsize-12 color CENTER fname
  119.           SetFont RESET 0
  120.         END
  121.         Goto ds
  122.       END
  123.     END
  124.   END
  125.   ELSE DO
  126.     IF command = 27 | command = 0 THEN DO /* ESC */
  127.       Goto nr
  128.       Call Cancel
  129.       END
  130.     IF command = 79 THEN DO /* <- */
  131.       nr = nr - (width%thumbsize)*(height%thumbsize)
  132.       IF nr < 1 THEN nr = 1
  133.       Goto nr
  134.       doit = 1
  135.       END
  136.     IF command = 78 | command = 32 THEN /* -> */
  137.       doit = 1
  138.     END
  139. END
  140.  
  141. EXIT
  142.  
  143.  
  144. ShowPicture:
  145.  
  146. ARG xx yy .
  147.  
  148. GetData $F1
  149. fname = result
  150. GetData $F4
  151. name = result
  152.  
  153. IsMarked
  154. IF RC = 5 THEN DO
  155.   Box xx-2 yy-2 thumbsize-7 thumbsize-6 1000
  156.   color = 1
  157.   END
  158. ELSE DO
  159.   Box xx-2 yy-2 thumbsize-7 thumbsize-6 1001
  160.   color = 3
  161.   END
  162.  
  163. LoadPic name xx yy CENTER
  164. IF RC = 0 THEN DO
  165.   picw = WORD(result,1)
  166.   pich = WORD(result,2)
  167.   Box xx+14+(120-picw)%2 yy+14+(120-pich)%2 picw+1 pich+1 1001
  168. END
  169.  
  170. Current
  171. xnr = result
  172. fpos = MAX(LastPos("/",fname),LastPos(":",fname))
  173. fname = UPPER(SubStr(fname,fpos+1,Length(fname)-fpos))
  174. SetFont Helvetica.font 9 0
  175. Text xx+(thumbsize%2)-4 yy+thumbsize-12 color CENTER fname
  176. SetFont Helvetica.font 11 0
  177. Text xx+4 yy+8 1 LEFT xnr
  178. SetFont RESET 0
  179.  
  180. RETURN
  181.  
  182.  
  183. Overview:
  184.  
  185. Display On
  186. ClearMask
  187. Display Off
  188. x = xoff
  189. y = yoff
  190.  
  191. weiter = 1
  192.  
  193. DO WHILE weiter = 1
  194.  
  195.   CALL ShowPicture x y
  196.   x = x + thumbsize
  197.   IF x > width-thumbsize THEN DO
  198.     IF y < height-(thumbsize*2) THEN DO
  199.       x = xoff
  200.       y = y + thumbsize
  201.       END
  202.     ELSE
  203.       weiter = 0
  204.     END
  205.   RightOne
  206.   IF RC ~= 0 THEN
  207.     weiter = 0
  208.  
  209. END
  210.  
  211. RETURN
  212.  
  213.  
  214. Cancel:
  215.  
  216. Display On
  217. LoadGadgets RESET
  218. Show NEW
  219. EXIT
  220.  
  221.